package com.chengwt.dao.impl;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.chengwt.entity.Information;
import com.chengwt.entity.User;
import com.chengwt.util.HibernateUtil;

public class UserInformationTest {
	public static void main(String args[]){
		Session session =HibernateUtil.getSession();
		Transaction tx = session.beginTransaction();
		
		try {
			User u = new User();
			u.setUserName("lili");
			
			User u1 = new User();
			u1.setUserName("Mary");
			
			Information i1 = new Information();
			i1.setInformationName("NIhao");
			
			Information i2 = new Information();
			i2.setInformationName("HIHI");
			
			session.save(u);
			session.save(i1);
			
			tx.commit();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}


